<?php

namespace App\Http\Requests\Api;

use Dingo\Api\Http\FormRequest;

class PostsRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        if ($this->isMethod('POST')) {
            return [
                'title' => [
                    'max:40',
                ],
                'content' => [
                    'max:190',
                ],
                'pictures' => [
                    'max:190',
                ],
            ];
        }
    }

}
